import Vue from 'vue'
import VueRouter from 'vue-router'

// 二级路由

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/views/layout'),
    redirect: '/home',
    children: [
      {
        path: 'home',
        component: () => import('@/views/layout/home'),
        meta: {
          isKeepAlive: true
        }
      },
      {
        path: 'classify',
        component: () => import('@/views/layout/classify')
      },
      {
        path: 'launch',
        component: () => import('@/views/layout/launch')
      },
      {
        path: 'user',
        component: () => import('@/views/layout/user')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login')
  },
  {
    path: '/enroll',
    component: () => import('@/views/enroll')
  },
  {
    path: '/articleList',
    component: () => import('@/views/articleList')
  },
  {
    path: '/userInfo',
    component: () => import('@/views/userInfo')
  },
  {
    path: '/details',
    component: () => import('@/views/details')
  },
  {
    path: '/user/zan',
    component: () => import('@/views/layout/user/zan')
  },
  {
    path: '/user/Article',
    component: () => import('@/views/layout/user/myArticle')
  }
]

const router = new VueRouter({
  routes
})

export default router
